# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentSpec do
  @moduledoc """
  PolicyContentSpec defines the user's desired content configuration on the cluster.

  ## Attributes

  *   `bundles` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.PolicyControllerBundleInstallSpec.t}`, *default:* `nil`) - map of bundle name to BundleInstallSpec. The bundle name maps to the `bundleName` key in the `policycontroller.gke.io/constraintData` annotation on a constraint.
  *   `templateLibrary` (*type:* `GoogleApi.GKEHub.V1.Model.PolicyControllerTemplateLibraryConfig.t`, *default:* `nil`) - Configures the installation of the Template Library.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bundles =>
            %{
              optional(String.t()) =>
                GoogleApi.GKEHub.V1.Model.PolicyControllerBundleInstallSpec.t()
            }
            | nil,
          :templateLibrary =>
            GoogleApi.GKEHub.V1.Model.PolicyControllerTemplateLibraryConfig.t() | nil
        }

  field(:bundles, as: GoogleApi.GKEHub.V1.Model.PolicyControllerBundleInstallSpec, type: :map)
  field(:templateLibrary, as: GoogleApi.GKEHub.V1.Model.PolicyControllerTemplateLibraryConfig)
end

defimpl Poison.Decoder, for: GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentSpec do
  def decode(value, options) do
    GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentSpec.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
